package jy.game.components.animation;


import java.util.List;

import jy.game.BasePojo;
import wx.xml.simpleframework.xml.Attribute;
import wx.xml.simpleframework.xml.Element;
import wx.xml.simpleframework.xml.ElementList;
import wx.xml.simpleframework.xml.Root;

@Root(name = "animation")
public class JyAnimationNode extends BasePojo {
    @Attribute public                   String                 name;
    @ElementList(name = "group", inline = true) public List<JyAnimationGroup> groups;

    @Override public String getPK() {
        return this.name;
    }

    public JyAnimationGroup getGroup(String name) {
        for (JyAnimationGroup animationGroup : this.groups) {
            if (animationGroup.name == name) {
                return animationGroup;
            }
        }
        return null;
    }
}
